package cn.itcast.fk;

import cn.itcast.base.BaseController;
import cn.itcast.domain.User;
import cn.itcast.domain.feedback.Feedback;
import cn.itcast.service.feedback.FeedbackService;
import cn.itcast.utils.FileUploadUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RequestMapping(value ="/user/feedback")
@Controller
public class FeedbackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;
    @Autowired
    private FileUploadUtil fileUploadUtil;
    @RequestMapping(value ="/list.do",name = "到用户反馈界面写反馈")
    public String list(){
     return "fankui/fankui";
    }
    @RequestMapping(value ="/save",name ="保存用户反馈")
    public String fk(Feedback feedback) throws Exception {
        feedback.setCompany_id(company_id);
        feedback.setCompany_name(company_name);
        feedbackService.wirteFk(feedback);
        return "fankui/FeedSuccerss";
    }
    @RequestMapping(value="/Succerss",name = "成功以后到主页")
    public String Succerss(){
        return "home/home";
    }


    @RequestMapping(value = "/findByFeed")
    public String findByFeed(String id){
     Feedback feedback=feedbackService.findByFeed(id);
     request.setAttribute("user",user);
     request.setAttribute("feedback",feedback);
        return "fankui/read-mail";
    }
}
